<%= tr8n_with_options_tag(:default_locale => Tr8n::Config.default_admin_locale, :admin => true) do %>

	<style>
		.language_case_rule {
			padding:5px;
			vertical-align:middle;
			border-bottom: 1px dotted #ccc;
		}
		
		.language_case_rule:hover {
			background-color:#eee;
		}
		
	</style>

	<%= render :partial => "/tr8n/common/header" %>
	
	<%=render(:partial => "basic_info", :locals => {:mode => :view}) %>
	<%=render(:partial => "prohibited_words", :locals => {:mode => :view}) %>
	<%=render(:partial => "grammar", :locals => {:mode => :view}) %>
	<% if Tr8n::Config.enable_language_cases? %>
	  <%=render(:partial => "language_cases", :locals => {:mode => :view}) %>
	<% end %>	
	
	<script>
	  function switchSectionMode(section, mode) {
	    Tr8n.Utils.update(section + '_container', '/tr8n/language/update_language_section', {
	        parameters: {section:section, mode:mode}
	    });
	  }
	  
	  function submitSection(section) {
	    if (section == "grammar") {
	      if (!confirm("<%=trla('Updating language rules may affect all existing translations for this language. Are you sure you want to do this?')%>"))
	        return;
	    }
	
	    if (section == "cases") {
	      if (!confirm("<%=trla('Updating language cases may affect all existing translations for this language. Are you sure you want to do this?')%>"))
	        return;
	    }
	    
	    var params = Tr8n.Utils.serializeForm(section + '_form');
	    params['section'] = section;
	    Tr8n.Utils.update(section + '_container', '/tr8n/language/update_language_section', {
	      parameters: params,
	      method: 'post'
	    });
	  }
	</script>
	
	<%= render :partial => "/tr8n/common/footer" %>

<% end %>
